home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-03-10 | 3.3 KB | 63 lines | [TEXT/MMCC] |
- /*****************************************************************************************************
- * *
- * FinderProgressBar.h - Copyright 1993 - 1995 Chris Larson (larson@cs.ucla.edu), All rights reserved *
- * *
- * This is the public header file for a CDEF which mimics the progress bar used by the Finder. This *
- * file and compiled derivatives may be freely used within any freeware/shareware/postcardware/… as *
- * long as you mention my name in your credits. Neither this source nor its compiled derivatives are *
- * in the public domain and may not be use in any form in public domain software. Neither this source *
- * nor its compiled derivatives may be used in any form in a commercial product without the expressed,*
- * written consent of the author (me). *
- * *
- * Version 2.0 -- March 10, 1995. *
- * *
- *****************************************************************************************************/
-
- // Constants
-
- #define cFPBFrameColorID 0 // The id of the frame color in a Bar’s color table.
- #define cFPBBodyColorID 1 // The id of the background color in a Bar’s color table.
- #define cFPBBarColorID 2 // The id of the bar color in a Bar’s color table.
-
- #define kFPBResourceID 200 // The Resource ID of our CDEF.
-
- #define kFPBDefaultVarCode 0 // Default variation code.
- #define kFPBCustomColorVarCode 1 // Variation code indicating use of control color table.
-
- #define progressBarProc ( 16 * ( kFPBResourceID ) + ( kFPBDefaultVarCode ) )
- #define customColorBarProc ( 16 * ( kFPBResourceID ) + ( kFPBCustomColorVarCode ) )
-
- #define kInProgressBarControlPart 50
-
- #define kFPBFrameCount 16 // The number of frames in the “Barber Pole” animation loop.
-
- //-----
- // short GetProgressBarAnimationFrame(ControlHandle theControlHandle);
- //-----
- #define GetProgressBarAnimationFrame(theControlHandle) \
- ( GetControlReference(theControlHandle) & 0x0000FFFF )
-
- //-----
- // void SetProgressBarAnimationFrame(ControlHandle theControlHandle, short frameNumber);
- //-----
- #define SetProgressBarAnimationFrame(theControlHandle,frameNumber) \
- { SetControlReference(theControlHandle,(0x7FFF0000 | ((frameNumber) % kFPBFrameCount))); \
- Draw1Control(theControlHandle); }
-
- //-----
- // void IncrementProgressBarAnimationFrame(ControlHandle theControlHandle, short increment);
- //-----
- #define IncrementProgressBarAnimationFrame(theControlHandle,increment) \
- SetProgressBarAnimationFrame(theControlHandle, \
- GetProgressBarAnimationFrame(theControlHandle) + (increment))
-
- //-----
- // void StartProgressBarAnimation(ControlHandle theControlHandle);
- //-----
- #define StartProgressBarAnimation(theControlHandle) SetProgressBarAnimationFrame(theControlHandle,0)
-
- //-----
- // void StopProgressBarAnimation(ControlHandle theControlHandle);
- //-----
- #define StopProgressBarAnimation(theControlHandle) SetControlReference(theControlHandle,0);
-